home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5923 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.3 KB

  1. Path: mailhub.scitec.com.au!ramsesy
  2. From: ramsesy@rd.scitec.com.au (Ramses Youhana)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: C Coding Standards
  5. Date: 21 Feb 1996 09:10:25 GMT
  6. Organization: SCITEC LIMITED, Sydney, Australia.
  7. Message-ID: <4geni1$o23@mailhub.scitec.com.au>
  8. References: <4fd3r1$5ae@LNCSEX0003.eu.btco.com> <larry_kearney-0802961600170001@amaryllisp1.appsig.com> <311B704D.39ED@oc.com>
  9. NNTP-Posting-Host: scitec7.scitec.com.au
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Larry Weiss (lfw@oc.com) wrote:
  13. > > > Anyone know where I can get a start on writing some coding standards...
  14. >  > > I would like to know what need s to be covered. Right now I can think of
  15. >  > >
  16. >  > > 1) Identifier naming conventions
  17. >  > > 2) Headers - code layout- indentation etc
  18. >  > >
  19. >  > > Anyone know of an existing standard which one can adopt ?
  20.  
  21. > Here are some topics that we cover in our coding standard at work:
  22. >   o module headers (both .c and .h)
  23. >   o function declaration header
  24. >   o variable names (both global and local)
  25. >   o statement typography
  26. >   o statement indention
  27. >   o expression typography
  28. >   o comment (both block and statement level)
  29. >   o function prototype policy
  30. >   o "Hungarian notation" policy
  31. >   o module names
  32. >   o component architecture issues
  33. >   o variable initialization policy
  34. >   o portability issues (type names, memory management isolation, etc.)
  35. >   o conditional compilation policy (#if, #ifdef usage)
  36. >   o makefile issues (dependency usage, -D switch policy, etc)
  37. >   o included file issues (multiple inclusion avoidance policies, etc)
  38. >   o Standard C compliance policy
  39. >   o max module length policy
  40. >   o debugging instrumentation policies (permanence, format, etc)
  41. >   o usage of TAB characters (allowed?, policy if allowed)
  42.  
  43. Here are some more that we include in our coding standards at work:
  44.     Identifier naming conventions:
  45.     -    Constants
  46.     -    Macros
  47.     -    Variables
  48.     -    Functions
  49.     -    Typedefs, struct, union and enum
  50.     -    Scope of Identifiers
  51.  
  52. Also for C++ you can add:
  53.     -    Class definitions
  54.     -    Function overloading
  55.  
  56. Also sometimes there may be the need to write modules in Assembly code or use inline
  57. assembly code.  For Assembly code you can specify a standard for:
  58.     -    Formatting
  59.     -    Labels
  60.     -    Conditional statements
  61.     -    Loops
  62.     -    Calling C functions.
  63.  
  64. I hope this helps.
  65.  
  66. Ramses.
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.